<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Absensi_mahasiswa_model extends zulModel{

	function __construct(){
			parent::__construct();
			$this->table_name	= "absensi_mahasiswa";
			$this->primary_key	= "ID_ABSENSI";
			$this->order_by		= "ID_ABSENSI ASC"; 
	}
	function get_absensi($ba,$bb){
		$query = $this->db->query("SELECT NRP, NAMA, SUM(TOTAL_ABSEN) AS TOTAL_ABSENSI FROM absensi_mahasiswa JOIN master_mahasiswa ON master_mahasiswa.ID_MAHASISWA = absensi_mahasiswa.ID_MAHASISWA WHERE master_mahasiswa.STATUS = 0 GROUP BY absensi_mahasiswa.ID_MAHASISWA HAVING TOTAL_ABSENSI <= " . $ba . " AND TOTAL_ABSENSI > " . $bb . " ORDER BY TOTAL_ABSENSI DESC");
		return $query->result_array();
	}
}
?>